<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>主页</title>
</head>
<body>
    <div align="center">
        <h1>人员列表</h1>
        <hr>
        <div><a href="/testview/add_person/">增加一条记录</a></div>
        <br>
        <table cellspacing=16px>
            <thead>
                <tr align="center">
                    <td>头像</td>
                    <td>姓名</td>
                    <td>邮箱</td>
                    <td>性别</td>
                    <td>附件</td>
                    <th colspan="2">操作</th>
                </tr>
            </thead>
            <tbody>
                {% for person in personList %}
                <tr>
                    <td><img src="/upload/{{person.head_img}}" style="height:60px; width:60px"></td>
                    <td>{{person.name}}</td>
                    <td>{{person.email}}</td>
                    <td>{{person.get_gender_display}}</td>
                    <td><a href="/upload/{{person.attachment}}"></a></td>
                    <td><a href="/testview/del_person/{{person.id}}/">删除</a></td>
                    <td><a href="/testview/edit_person/{{person.id}}/">修改</a></td>
                </tr>
                {%empty%}
                <tr>
                    <td colspan="7">无相关记录！</td>
                </tr>
                {%endfor%}
            </tbody>
        </table>
    </div>
</body>
</html>